﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;


namespace Sharp.Portal.Mvc
{
    /// <summary>
    /// 扩展方法
    /// </summary>
    public static class FieldExtension
    {
        ///// <summary>
        ///// 响应客户端更新
        ///// </summary>
        ///// <typeparam name="TField"></typeparam>
        ///// <param name="field"></param>
        ///// <param name="clientUpdate"></param>
        ///// <returns></returns>
        //public static TField ClientUpdate<TField>(this TField field, bool clientUpdate) where TField : FormElementItem
        //{
        //    field.ClientUpdate = clientUpdate;
        //    return field;
        //}
        ///// <summary>
        ///// 字段占位宽度
        ///// </summary>
        ///// <typeparam name="TField"></typeparam>
        ///// <param name="field"></param>
        ///// <param name="width"></param>
        ///// <returns></returns>
        //public static TField Width<TField>(this TField field, int width) where TField : FormElementItem
        //{
        //    field.Width = width;
        //    return field;
        //}
        ///// <summary>
        ///// 字段占位高度
        ///// </summary>
        ///// <typeparam name="TField"></typeparam>
        ///// <param name="field"></param>
        ///// <param name="height"></param>
        ///// <returns></returns>
        //public static TField Height<TField>(this TField field, int height) where TField : FormElementItem
        //{
        //    field.Height = height;
        //    return field;
        //}



        ///// <summary>
        ///// 只读
        ///// </summary>
        ///// <typeparam name="TField"></typeparam>
        ///// <param name="field"></param>
        ///// <param name="readOnly"></param>
        ///// <returns></returns>
        //public static TField ReadOnly<TField>(this TField field, bool readOnly) where TField : FormTextFieldBase
        //{
        //    field.ReadOnly = readOnly;
        //    return field;
        //}
        ///// <summary>
        ///// 是否密码
        ///// </summary>
        ///// <typeparam name="TField"></typeparam>
        ///// <param name="field"></param>
        ///// <param name="isPassword"></param>
        ///// <returns></returns>
        //public static TField IsPassword<TField>(this TField field, bool isPassword) where TField : FormTextFieldBase
        //{
        //    field.IsPassword = isPassword;
        //    return field;
        //}

        ///// <summary>
        ///// 配置文字项代码项
        ///// </summary>
        ///// <typeparam name="TField"></typeparam>
        ///// <param name="field"></param>
        ///// <param name="displayField"></param>
        ///// <param name="valueField"></param>
        ///// <returns></returns>
        //public static TField DisplayValue<TField>(this TField field, string displayField, string valueField)
        //    where TField : FormKeyValueFieldBase
        //{
        //    field.DisplayField = displayField;
        //    field.ValueField = valueField;
        //    return field;
        //}
    }
}